home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr14 / jethro10.zip / JETHRO.L < prev   
Text File  |  1993-06-10  |  7KB  |  262 lines

  1.  
  2.  /* jethro.l */
  3.  
  4.  /* 
  5.  **   jethro  v. 1.00 06/10/93
  6.  **   Duane Paulson <ci922@cleveland.freenet.edu> "dap"
  7.  **   Hillbilly text filter. Compile with lex, then C.
  8.  **   syntax will be:
  9.  **      jethro <input_file >output_file.
  10.  **   Public domain. Use at your own risk. Y'all come back now, heah?
  11.  */
  12.  /*************************************************************************
  13.                 REVISION LOG
  14.  when      ver   who  change
  15.  --------  ----  ---  -----------------------------------------------------
  16.  06/10/93  1.00  dap  Initial release.
  17.  *************************************************************************/
  18.  
  19. SW    [\n \"(]
  20. EW    [\n ".",\"!?):;]
  21. BW    [\n ]
  22.  
  23.     #define PUTLAST unput(*(yytext+strlen(yytext)-1));
  24.     #define SUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1);
  25.     #define SSUB(A) fprintf(yyout, "%c%c%s", *yytext,\
  26.         *A|(*(yytext+1)&32), A+1);
  27.     #define SESUB(A) fprintf(yyout, "%c%c%s", *yytext,\
  28.         *A|(*(yytext+1)&32), A+1); PUTLAST;
  29.     #define ESUB(A) fprintf(yyout, "%c%s", *A|(*yytext&32), A+1); PUTLAST;
  30.  
  31.     #include <string.h>
  32.  
  33. %%
  34.  
  35. {SW}[Gg]reetings{EW}    |
  36. {SW}[Hh]i{EW}        |
  37. {SW}[Hh]ello{EW}    SESUB("Howdy");
  38. {SW}[Bb]ye{EW}        |
  39. {SW}[Gg]oodbye{EW}    SESUB("Y'all come back now, heah?");
  40. {SW}[Hh]ear{EW}    SESUB("Heah");
  41. {SW}[Cc]ar{EW}        |
  42. {SW}[Aa]uto{EW}        |
  43. {SW}[Rr]elax{EW}    SESUB("Set a spell -- put yore feet up");
  44. {SW}[Aa]utomobile{EW}    SESUB("Gasoline buggy");
  45. [Ss]wimming{BW}pool    SUB("Cement pond");
  46. [Pp]ool{BW}table    SUB("Fancy eatin table");
  47. [Pp]ool{BW}cue        |
  48. [Cc]ue{BW}stick        SUB("Fancy pot passer");
  49. {SW}[Bb][r]?oil{EW}    |
  50. {SW}[Bb]ake{EW}        |
  51. {SW}[Ff]ry{EW}        |
  52. {SW}[Ss]aute{EW}    |
  53. {SW}[Cc]ook{EW}    SESUB("Whomp up");
  54. {SW}[Bb][r]?oiling{EW}    |
  55. {SW}[Bb]akeing{EW}    |
  56. {SW}[Ff]rying{EW}    |
  57. {SW}[Ss]auteing{EW}    |
  58. {SW}[Cc]ooking{EW}    SESUB("Whompin up");
  59. {SW}[Bb][r]?oiled{EW}    |
  60. {SW}[Bb]aked{EW}    |
  61. {SW}[Ff]ryed{EW}    |
  62. {SW}[Ss]auted{EW}    |
  63. {SW}[Cc]ooked{EW}    SESUB("Done whomped up");
  64. {SW}[Bb][r]?oils{EW}    |
  65. {SW}[Bb]akes{EW}    |
  66. {SW}[Ff]rys{EW}        |
  67. {SW}[Ss]autes{EW}    |
  68. {SW}[Cc]ooks{EW}    SESUB("Whomps up");
  69. {SW}[Gg]roceries{EW}    |
  70. {SW}[Ff]ood{EW}        SESUB("Vittles");
  71. [Ss]alad        SUB("Slaw");
  72. [Vv]egetable        SUB("Green");
  73. [Pp]otato        SUB("Tater");
  74. {SW}[Tt]omato        SSUB("Tuhmater");
  75. {SW}[Rr]hubarb{EW}    SESUB("Pie plant");
  76. {SW}[Ll]iquor{EW}    |
  77. {SW}[Ww]hisk[e]?y{EW}    |
  78. {SW}[Ss]cotch{EW}    |
  79. {SW}[Bb]ourbon{EW}    |
  80. {SW}[Gg]in{EW}        |
  81. {SW}[Vv]odka{EW}    |
  82. {SW}[Tt]equila{EW}    |
  83. {SW}[Ll]iqueur{EW}    SESUB("Rheumatiz medcin");
  84. {SW}[Bb]ooze{EW}    SESUB("Corn likker");
  85. {SW}[Cc]ocktail{EW}    |
  86. {SW}[Mm]ixed{BW}drink{EW} SESUB("Waste of good likker");
  87. {SW}[Bb]ar{EW}        SESUB("Dance hall");
  88. {SW}[Bb]ars{EW}        SESUB("Dance halls");
  89. {SW}[Ss]aloon        |
  90. {SW}[Cc]ocktail{BW}lounge SESUB("Dance hall");
  91. {SW}[Ww]hore        |
  92. {SW}[Pp]rostitute    |
  93. {SW}[Ss]lut        SSUB("Dance hall girl");
  94. {SW}[Ss]ecret{BW}agent{EW} |
  95. {SW}[Ss]py{EW}        |
  96. {SW}007{EW}        SESUB("Double nought spy");
  97. {SW}[Zz]ero{EW}        SESUB("Nought");
  98. {SW}[Pp]ants{EW}    SESUB("Trousers");
  99. {SW}[Jj]eans{EW}    |
  100. {SW}[Dd]ungarees{EW}    |
  101. {SW}[Ll]evi[']?s{EW}    SESUB("Overhalls");
  102. {SW}[Ss]hoe        SSUB("High-button shoe");
  103. {SW}[Jj]acket        SSUB("Coat");
  104. {SW}[Ss]hotgun        SSUB("Fowlin piece");
  105. {SW}[Rr]evolver        |
  106. {SW}[Gg]un        SSUB("Shootin iron");
  107. {SW}[Rr]ifle        SSUB("Ozark longrifle");
  108. {SW}[Ll]ibrar[yi]    SSUB("Liberry");
  109. [Ww]ash            SUB("Warsh");
  110. [Ff]amily        SUB("Fambly");
  111. [Ff]ry{BW}pan        |
  112. [Ff]rying{BW}pan    |
  113. [Ss]aute{BW}pan        SUB("Skillet");
  114. {SW}[Aa]nimal        SSUB("Critter");
  115. {SW}FBI{EW}        |
  116. {SW}F.B.I.{EW}        |
  117. {SW}CIA{EW}        |
  118. {SW}C.I.A.{EW}        |
  119. {SW}ATF{EW}        |
  120. {SW}A.T.F.{EW}        |
  121. {SW}IRS{EW}        |
  122. {SW}I.R.S.{EW}        |
  123. {SW}SS{EW}        |
  124. {SW}S.S.{EW}        |
  125. {SW}[Ss]elective{BW}[Ss]ervice{EW} |
  126. {SW}[Ss]elective{BW}[Ss]ervice{BW}[Ss]ystem{EW} |
  127. {SW}[Ss]ecret{BW}[Ss]ervice{EW} SESUB("Revanooers");
  128. {SW}[Pp]olice        |
  129. {SW}[Pp]oliceman    |
  130. {SW}[Ss]heriff        |
  131. {SW}[Dd]eputy        |
  132. {SW}[Dd]eputy{BW}[Ss]heriff |
  133. {SW}[Mm]arshall        |
  134. {SW}[Dd]eputy{BW}[Mm]arshall |
  135. {SW}[Pp]ark{BW}[Rr]anger |
  136. {SW}[Tt]exas{BW}[Rr]anger |
  137. {SW}[Hh]ighway{BW}[Pp]atrol SSUB("Constable");
  138.  
  139. {SW}[Mm]other        |
  140. {SW}[Mm][ao]mm[ay]?     |
  141. {SW}[Mm]ommie        |
  142. {SW}[Mm]om        SSUB("Maw");
  143. {SW}[Mm]a{EW}        SESUB("Maw");
  144. {SW}[Ff]ather        SSUB("Paw");
  145. {SW}[Dd]ad{EW}        |
  146. {SW}[Dd]addy        |
  147. {SW}[Pp]a{EW}        |
  148. {SW}[Pp][ao]p{EW}    |
  149. {SW}[Pp][ao]pp[ay]?{EW} SESUB("Paw");
  150. {SW}[Gg]randmother{EW}    |
  151. {SW}[Gg]randma[w]?{EW}    SESUB("Granny");
  152. {SW}[Gg]randfather{EW}    |
  153. {SW}[Gg]ran[d]{1,2}ad[d]?[y]?{EW} |
  154. {SW}[Gg]randpop{EW}    |
  155. {SW}[Gg]randpa[w]?{EW}    SESUB("Grampy");
  156. {SW}[Mm]y{EW}        SESUB("Mah");
  157. {SW}them{EW}        SESUB("em");
  158. [Dd]og            SUB("Dawg");
  159. [Ll]awyer        |
  160. [Ll]egal{BW}counc[ei]l    |
  161. [Ll]egal{BW}councellor    |
  162. [Aa]ttorney        |
  163. [Aa]ttorney{BW}[Aa]t{BW}[Ll]aw SUB("City slicker");
  164.  
  165. {SW}[Tt]han{EW}        SESUB("Then");
  166. [Cc]haracterize        SUB("Show");
  167. {SW}[Vv]ery{EW}        |
  168. {SW}[Ee]xtremely{EW}    |
  169. {SW}[Rr]eally{EW}    |
  170. {SW}[Rr]eal{EW}        SESUB("Right");
  171. {SW}[Hh]aven't{EW}    |
  172. {SW}[Ii]sn't{EW}    |
  173. {SW}[Aa]ren't{EW}    SESUB("Aint");
  174. {SW}[Ss]aid{EW}        |
  175. {SW}[Ss]ays{EW}        SESUB("Sez");        
  176. {SW}[Aa]re{EW}        SESUB("Is");
  177. {SW}[Ss]hould{EW}    SESUB("Ortta");
  178. {SW}[Pp]erhaps{EW}    |
  179. {SW}[Mm]aybe{EW}    SESUB("Mebbe");
  180. {SW}[Ss]ick{EW}        SESUB("Ailin'");
  181. {SW}I'm{BW}not{EW}    SESUB("I aint");
  182. {SW}[Ss]cared{EW}    SESUB("A-skeert");
  183. {SW}[Ss]care        SSUB("Skeer");
  184. {SW}[Hh]ave{EW}        SESUB("Got");
  185. {SW}[Pp]ossess{EW}    SESUB("Have");
  186. {SW}[Hh]elp        SSUB("Hep");
  187. {SW}[Tt]ired{EW}    SESUB("Tuckered out");
  188. {SW}[Cc]ompletely{EW}    SESUB("Plumb");
  189. {SW}[Dd]runk{EW}    SESUB("A mite woozy");
  190.  
  191. {SW}[Yy]es{EW}        SESUB("Yep");
  192. {SW}[Nn]o{EW}        SESUB("Nope");
  193.  
  194. {SW}[Ii]t{BW}is{EW}    SESUB("Tis");
  195. {SW}[Aa]t{BW}all{EW}    *(yytext+1)=(char)'A'; SESUB("A tall");
  196.  
  197. {SW}[Aa]m{EW}        |
  198. {SW}[Aa]re{EW}        SESUB("Is");
  199. {SW}[Ww]as{EW}        |
  200. {SW}[Ww]ere{EW}        SESUB("Wuz");
  201. {SW}[Ww]asn't{EW}    SESUB("Wasunt");
  202. [Ee]very        SUB("Ever");
  203. {SW}[Ww]ant/s        SSUB("Is after");
  204. {SW}[Ww]anted{EW}    SESUB("Was after");
  205. {SW}[Ww]anting{EW}    SESUB("Hankering after");
  206. {SW}[Dd]oesn't{EW}    |
  207. {SW}[Dd]on't{EW}    SESUB("Dasent");
  208. {SW}[Yy]ou'll{EW}    SESUB("Y'all will");
  209. {SW}[Yy]our        SSUB("Yore");
  210. {SW}[Mm]ore{EW}        SESUB("Mo");
  211. tial            SUB("shul");
  212. cious            SUB("shus");
  213. ious            SUB("yus");
  214. tion            SUB("shun");
  215. {SW}[Cc]an{EW}        SESUB("C'n");
  216. {SW}[Yy]ou{EW}        SESUB("Y'all");
  217. {SW}[Ff]or{EW}        SESUB("Fer");
  218. {SW}[Tt]he{EW}        SESUB("Duh");
  219. ing            SUB("in");
  220. {SW}[Tt]oo{EW}        SESUB("Besides");
  221. {SW}[Tt]o{EW}        SESUB("Tuh");
  222. {SW}[Aa][n]?{EW}    SESUB("Ah");
  223. {SW}[Aa]re{EW}        |
  224. {SW}[Oo]ur{EW}        |
  225. {SW}[Oo]r{EW}        SESUB("Ore");
  226. {SW}[Oo]f{EW}        SESUB("Uv");
  227. {SW}I{EW}        SESUB("Ah");
  228. {SW}I'm{EW}        SESUB("Ahm a");
  229. {SW}I'll{EW}        SESUB("Ahl");
  230. {SW}I'd{EW}        SESUB("Ah wood");
  231. 'nt            *(yytext)=(char)'u'; SUB("unt");
  232. 're            SUB(" is");
  233. 've            SUB(" done");
  234. eed{EW}            ECHO;
  235. ed{EW}            ESUB("d");
  236. {SW}[Oo]wn{EW}        |
  237. {SW}[Tt]own{EW}        |
  238. {SW}[Dd]own{EW}        |
  239. {SW}[Gg]own{EW}        |
  240. {SW}[Bb]rown{EW}    ECHO;
  241. wn{EW}            ESUB("ed");
  242. {SW}[Bb]elow{EW}    |
  243. {SW}[Kk]now{EW}        |
  244. {SW}[Tt]hrow{EW}    |
  245. {SW}[Gg]row{EW}        |
  246. {SW}[Hh]ow{EW}        |
  247. {SW}[Nn]ow{EW}        |
  248. {SW}[Bb]row{EW}        |
  249. {SW}[Ss]how{EW}        ECHO;
  250. ow{EW}            ESUB("er");
  251. re{EW}            |
  252. er{EW}            ESUB("uh");
  253. {SW}[Hh]er{EW}        ECHO;
  254. !            SUB(". Ye DAWGies!!!");
  255.  
  256. %%
  257.  
  258. main()
  259. {
  260.     yylex();
  261. }
  262.